import 'package:flutter/material.dart';

class TagBadge extends StatelessWidget {
  final Color? color;
  final Color? textColor;
  final int? count;
  final double size;

  const TagBadge({
    Key? key,
    this.color = Colors.red,
    this.textColor = Colors.white,
    this.count,
    this.size = 16,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    if (count == null || count! <= 0) return Container();
    return Container(
      width: size,
      height: size,
      alignment: Alignment.center,
      decoration: BoxDecoration(
        borderRadius: BorderRadius.all(Radius.circular(size)),
        color: color,
      ),
      child: Text(
        count! > 99 ? '...' : count.toString(),
        style: TextStyle(fontSize: size / 1.5, color: textColor),
      ),
    );
  }
}
